<?php


class Model_Payroll_Supercomp extends Zend_Db_Table_Abstract {

	protected $_name = 'super_company';
	
	public function getSupercomp( $idSc){
		
		$row = $this->fetchRow("`id_sc` = ". $idSc);
		if(!$row) return false;
		return $row->toArray();		
		
		}
		
	public function addSupercomp( $nameSp){
		
		$data = array(
			
         "name_sp" =>  $nameSp 
	
			);
		$this->insert($data);
		
		}
		
	public function updateSupercomp(  $idSc ,  $nameSp){
		$data = array(
			
         "name_sp" =>  $nameSp 
	
			);
			
		$this->update($data,"`id_sc` = ". $idSc);
		}
		
	public function deleteSupercomp( $idSc){
		
		$this->delete("`id_sc` = ". $idSc);
		
		}	
	
	public function listAll(){
		
		$rows =$this->fetchAll("1","id_sc DESC ");
		if(!$rows) return false;
		return $rows->toArray();			
		
		}	
}


?>